import  {xsEntity} from '../commentity';

import { Column ,Entity ,ManyToOne, OneToMany} from 'typeorm';
import { NovelEntity } from '../novel/novel';
import { PartinfoEntity } from '../userinfo/useractive';


/**
 * 描述
 */
@Entity()
export class NovelPartEntity extends xsEntity {

  // 关联父亲 Pid
  @ManyToOne(() => NovelEntity, NovelEntity => NovelEntity.novels)
  Pid: NovelEntity;








  @Column({ comment: '文章标题' ,default:null })
  articleTitle: string;
  @Column({ comment: '文章内容' ,  default:null,type:"longtext" })
  articleContent: string; 
  @Column({ comment: '浏览量' ,default:0 })
  Views: number;
  
  // 连用户阅读时间
  @OneToMany( ()=>PartinfoEntity , PartinfoEntity => PartinfoEntity.part)
  times: PartinfoEntity
  


  @Column({ comment: '排序',default:null })
  sort: number;

  @Column({ comment: '是否收费' ,default:true })
  status: boolean;

  @Column({ comment: '停留时间 一对多',default:0 })
  residenceTime: string;
  @Column({ comment: '评论' ,default:null  })

  comment: string;
}
